import request from '@/utils/request'
import {commercialApiUrl} from '../config'

// 设计变更管理


/**
 * 分页查询
 * @param {Object} data
 */
export function getDesignChangeList(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/list`,
        method: 'post',
        data: data
    })
}

/**
 * 数据归档填写
 * @param {Object} data
 */
export function addDesignChange(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/addArchive`,
        method: 'post',
        data: data
    })
}

/**
 * 新增或修改-设计变更数据
 * @param {Object} data
 */
export function updateDesignChange(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/addOrUpdate`,
        method: 'post',
        data: data
    })
}

/**
 * 删除/撤销/作废 总包计量-设计变更
 * @param {Object} data
 */
export function delDesignChange(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/delData?id=${data.id}&type=${data.type}`,
        method: 'get',
    })
}

/**
 *设计变更详情
 * @param {Object} data
 */
export function getDesignChangeDetail(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/detail?id=${data.id}`,
        method: 'get',
    })
}

/**
 *设计变更统计
 * @param {Object} data
 */
export function getCountDesignChange(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/getCount`,
        method: 'post',
        data: data
    })
}

/**
 * 获取新增名称接口
 * @param {Object} data
 */
export function getCheckName(data) {
    return request({
        url: `${commercialApiUrl}/cost-design-change/checkName`,
        method: 'get',
    })
}